import { runDataBase, closeDataBase, exectureSQL } from './oracleDB';

const { ipcMain } = require('electron');

let functionJSON = {
  runDataBase,
  closeDataBase,
  exectureSQL,
};
ipcMain.on('runDataBase', (event, arg) => {
  let exeFunction = functionJSON[arg.type];
  console.log(exeFunction, 'exeFunction');
  exeFunction(arg.data).then((res) => {
    //   // 处理事件并发送回渲染进程
    event.sender.send(arg.type, res);
  });
});
